package com.xjscrm.console.service.customer.chat;

import com.xjscrm.common.annotation.MerId;
import com.xjscrm.console.dto.chat.ChatTalkRecordQueryDTO;
import com.xjscrm.console.entity.ChatTalkRecord;
import com.xjscrm.console.entity.ChatTalkSession;

import java.util.List;

/**
 * 聊天记录(ChatTalkRecord)表服务接口
 *
 * @author szl
 * @since 2024-03-12 13:36:00
 */
public interface ChatTalkRecordService {

    ChatTalkRecord loadLastTalk(ChatTalkRecordQueryDTO chatTalkRecordQuery);

    ChatTalkRecord getById(ChatTalkRecordQueryDTO chatTalkRecordQuery);

    ChatTalkRecord getById(Long merId, Long id);

    ChatTalkRecord getById(Long merId, Long id, Long talkSessionId);

    List<ChatTalkRecord> listByIds(Long merId, List<Long> ids, Long talkSessionId);

    void add(ChatTalkRecord chatTalkRecord);

    void updateById(ChatTalkRecord byId);

    List<ChatTalkRecord> listByTime(ChatTalkRecordQueryDTO query);

    Integer countWithNoRead(Long merId, Long talkSessionId, Integer lastReadTime);

    ChatTalkRecord buildTextRecord(Long merId, Long staffId, ChatTalkSession talkSession, String replyText);

    void cleanChatTalkRecord(@MerId Long merId);

    void deleteOfRecallIfAbsent(Long merId, Long recordId);

    ChatTalkRecord getLastTalk(Long merId, Long deviceUniqueId, Long sessionId);
}

